package com.crazy.multids.config.common;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Set;

/**
 * 此类的描述是：
 *
 * @author crazyhu@wezhuiyi.com
 * @date 2018-09-16 12:32
 **/
@Slf4j
public class MultipleDataSource {

    private List<String> dataSources;

    private String defaultDataSource;

    public MultipleDataSource(List<String> dataSources) {
        if (CollectionUtils.isEmpty(dataSources)) {
            log.warn("dataSources is empty!");
        }
        this.dataSources = dataSources;
        this.defaultDataSource = dataSources.get(0);
    }

    public List<String> getDataSources() {
        return dataSources;
    }

    public void setDataSources(List<String> dataSources) {
        this.dataSources = dataSources;
    }

    public String getDefaultDataSource() {
        return defaultDataSource;
    }

    public void setDefaultDataSource(String defaultDataSource) {
        this.defaultDataSource = defaultDataSource;
    }
}
